const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/members');

const Schema = mongoose.Schema;

var studentSchema = new Schema({
    name: {
        type: String,
        required: true
    },
    gender: {
        type: Number,
        enum: [0,1], // 枚举
        default: 0
    },
    age: {
        type: Number
    },
    from: {
        type: String
    },
    job: {
        type: String
    }
});

// 导出模型构造函数
module.exports = mongoose.model('student',studentSchema);
